package homework;
import java.util.Random;
public class day05扩展 {
    public static void main(String[] args) {

        int sum = 0;
        for (int i=2;i<=100;i+=2){
        sum +=i;
        }
        System.out.println("sum:"+sum);
        System.out.println();
        int num = 1;
        for (int i =1;i<=8;i++){
            num*=i;
        }
        System.out.println("num="+num);
        System.out.println();
        /*          行 星
        *           1  1
        ***         2  3
        *****       3  5
        *******     4  7
        *********   5  9
        *********** 6  11
         */
        int n =6;
        for (int i =1;i<=n;i++){
            for (int j=0;j<i*2-1;j++){
                System.out.print("*");
            }
            System.out.println();
        }
        int[] arr = new int[10];
        Random rand =new Random();
        for (int i = 0;i<arr.length;i++){
            arr[i] = rand.nextInt(100);
            System.out.println(arr[i]);
        }
        int max = arr[0];
        int min = arr[0];
        for (int i=1;i<arr.length;i++){
            if (arr[i]>max){
                max = arr[i];
            }
            if (arr[i]<min){
                min = arr[i];
            }
        }

        System.out.println("最大值为:"+max+",最小值为:"+min);




















    }
}
